package org.s170.servlet.WebServlet;

import org.s170.dao.NoteTypeDao;
import org.s170.entity.NoteType;
import org.s170.servlet.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/api/noteType.do")
public class NoteTypeServlet extends BaseServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        NoteTypeDao noteTypeDao = new NoteTypeDao();
        List<NoteType> list = noteTypeDao.getAllNoteType();
        print(resp,successJson(list));

    }
}
